<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <button id="btn">弹窗</button>
    <script>
        function show(){
            console.log("111");
            clearTimeout(timer);
            timer=null;
        }

        var timer=null;
        btn.onclick=function(){
            if(timer==null){
                timer=setTimeout(show,1000)
            }  
        }
    </script>
</body>
</html>